package com.cnap.multiclouldmgmt.model.k8sModels;

import com.cnap.multiclouldmgmt.model.K8sClusterInfoModel;
import com.cnap.multiclouldmgmt.util.DateUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;
/**
 * 集群组件基础信息
 * @author dyq
 */
@ApiModel(value = "com.cnap.multiclouldmgmt.model.k8sModels.WorkLoadModel",description = "工作负载信息")
public class WorkLoadModel extends K8sClusterInfoModel {

    //WorkLoad名称
    @ApiModelProperty(value = "WorkLoad名称")
    private String workLoadName;

    //WorkLoad类型
    @ApiModelProperty(value = "WorkLoad类型")
    private String workLoadKind;

    //workLoad描述
    @ApiModelProperty(value = "workLoad描述")
    private String describe;

    //状态
    @ApiModelProperty(value = "状态")
    private String status;

    //命名空间
    @ApiModelProperty(value = "命名空间")
    private String namespace;

    //pod希望副本数量
    @ApiModelProperty(value = "pod希望数量")
    private int replicas;

    //pod实际数量
    @ApiModelProperty(value = "pod实际数量")
    private int podNum;

    //创建时间
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    //部署的yaml
    @ApiModelProperty(value = "部署的yaml")
    private String yaml;

    //pod里面对应的容器们
    @ApiModelProperty(value = "pod里面对应的容器们")
    private List<ContainerModel> containerModels;

    //服务名称
    @ApiModelProperty(value = "服务名称")
    private String svcName;

    //创建时间格式化
    @ApiModelProperty(value = "创建时间格式化")
    private String createTimeStr;

    public String getCreateTimeStr() {

        if ((StringUtils.isEmpty(createTimeStr))
                &&(createTime != null)){
            createTimeStr = DateUtils.changeDateFormatYYYYMMDDHHMMSS(createTime);
        }

        return createTimeStr;
    }

    /**
     * get
     *
     * @return WorkLoadName
     */
    public String getWorkLoadName() {
        return workLoadName;
    }

    /**
     * set
     *
     * @param workLoadName workLoadName
     */
    public void setWorkLoadName(String workLoadName) {
        this.workLoadName = workLoadName;
    }

    /**
     * get
     *
     * @return WorkLoadKind
     */
    public String getWorkLoadKind() {
        return workLoadKind;
    }

    /**
     * set
     *
     * @param workLoadKind workLoadKind
     */
    public void setWorkLoadKind(String workLoadKind) {
        this.workLoadKind = workLoadKind;
    }

    /**
     * get
     *
     * @return Describe
     */
    public String getDescribe() {
        return describe;
    }

    /**
     * set
     *
     * @param describe describe
     */
    public void setDescribe(String describe) {
        this.describe = describe;
    }

    /**
     * get
     *
     * @return Status
     */
    public String getStatus() {
        return status;
    }

    /**
     * set
     *
     * @param status status
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * get
     *
     * @return Namespace
     */
    public String getNamespace() {
        return namespace;
    }

    /**
     * set
     *
     * @param namespace namespace
     */
    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    /**
     * get
     *
     * @return Replicas
     */
    public int getReplicas() {
        return replicas;
    }

    /**
     * set
     *
     * @param replicas replicas
     */
    public void setReplicas(int replicas) {
        this.replicas = replicas;
    }

    /**
     * get
     *
     * @return PodNum
     */
    public int getPodNum() {
        return podNum;
    }

    /**
     * set
     *
     * @param podNum podNum
     */
    public void setPodNum(int podNum) {
        this.podNum = podNum;
    }

    /**
     * get
     *
     * @return CreateTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * set
     *
     * @param createTime createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * get
     *
     * @return Yaml
     */
    public String getYaml() {
        return yaml;
    }

    /**
     * set
     *
     * @param yaml yaml
     */
    public void setYaml(String yaml) {
        this.yaml = yaml;
    }

    /**
     * get
     *
     * @return ContainerModels
     */
    public List<ContainerModel> getContainerModels() {
        return containerModels;
    }

    /**
     * set
     *
     * @param containerModels containerModels
     */
    public void setContainerModels(List<ContainerModel> containerModels) {
        this.containerModels = containerModels;
    }

    /**
     * get
     *
     * @return SvcName
     */
    public String getSvcName() {
        return svcName;
    }

    /**
     * set
     *
     * @param svcName svcName
     */
    public void setSvcName(String svcName) {
        this.svcName = svcName;
    }

    /**
     * set
     *
     * @param createTimeStr createTimeStr
     */
    public void setCreateTimeStr(String createTimeStr) {
        this.createTimeStr = createTimeStr;
    }
}
